using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class AT2_NameMap : EntityTypeConfiguration<AT2_Name>
    {
        public AT2_NameMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Field)
                .HasMaxLength(50);

            this.Property(t => t.FieldCaption)
                .HasMaxLength(50);

            this.Property(t => t.Table)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("AT2_Name");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Field).HasColumnName("Field");
            this.Property(t => t.FieldCaption).HasColumnName("FieldCaption");
            this.Property(t => t.Table).HasColumnName("Table");
        }
    }
}
